package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IForegroundProductDao;
import com.financing.platform.dto.ForegroundProductDTO;
import com.financing.platform.util.SqlName;



@Repository("foregroundProductDao")
public class ForegroundProductDaoImpl extends BaseDaoImpl implements IForegroundProductDao {


	@Override
	public int addForegroundProduct(ForegroundProductDTO foregroundProductDto) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.addForegroundProduct,foregroundProductDto);
	}

	@Override
	public List<ForegroundProductDTO> queryForegroundProduct(
			ForegroundProductDTO foregroundProductDto) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryforegroundProduct,foregroundProductDto);
	}

	@Override
	public int editForegroundProduct(ForegroundProductDTO foregroundProductDto)
			throws SQLException {
		return this.sqlMapClient.update(SqlName.editForegroundProduct,foregroundProductDto);
	}

	@Override
	public Integer countForegroundProduct(ForegroundProductDTO foregroundProductDto)
			throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.countForegroundProduct,foregroundProductDto);
	}

	@Override
	public List<ForegroundProductDTO> queryForegroundProductBySendEmail(
			String pids) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryForegroundProductBySendEmail,pids);
	}

	@Override
	public List<Map<String, Object>> queryForegroundProductBySendSMS()
			throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryForegroundProductBySendSMS);
	}

	@Override
	public Map<String,Object> queryForegroundProductDetail(
			ForegroundProductDTO foregroundProductDto) throws SQLException {
		return (Map<String, Object>) this.sqlMapClient.queryForObject(SqlName.queryForegroundProductDetail,foregroundProductDto);
	}

	
}
